#include <stdio.h>
void twosum(int nums[], int size, int target, int *result)
{
    int i, j;
    for (i = 0; i < size - 1; i++)
    {
        for (j = i + 1; j < size; j++)
        {
            if (nums[i] + nums[j] == target)
            {
                result[0] = i;
                result[1] = j;
                return;
            }
        }
    }
}

int main()
{
    int size, target;
    printf("输入数组的大小： ");
    scanf("%d", &size);

    int nums[size];
    printf("输入数组的元素:\n");
    for (int i = 0; i < size; i++)
    {
        scanf("%d", &nums[i]);
    }

    printf("输入目标值: ");
    scanf("%d", &target);

    int result[2] = {0};

    twosum(nums, size, target, result);

    printf("目标值对应数组中数字的下标位置: [%d, %d]\n", result[0], result[1]);

    return 0;
    
}